#!/bin/bash

sudo cp /vagrant/resources/mariadb/mariadb.repo /etc/yum.repos.d/

# mariadb
sudo yum -y install MariaDB-server MariaDB-client

sudo systemctl start mariadb #启动服务
sudo systemctl enable mariadb #设置开机启动

sudo mysql -uroot  < /vagrant/resources/mariadb/init.sql

sudo cp /vagrant/resources/mariadb/server.cnf /etc/my.cnf.d/

#cat << EOF > /etc/my.cnf.d/server.cnf
#[mysqld]
#character-set-server=utf8 
#collation-server=utf8_unicode_ci 
#EOF


#show variables like "%character%";show variables like "%collation%";
#create user username@localhost identified by 'password';
#grant all privileges on *.* to username@'%' identified by 'password';
